using CoreModule.WorkItems.Customer;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.CompositeUI.WinForms;

namespace Module.Extension.FileManagerModule
{
	[WorkItemExtension(typeof(CustomerWorkItem))]
	public class MyWorkItemExtension : WorkItemExtension
	{
        private FileManagerView view;

		protected override void OnActivated()
		{
            if (view == null)
			{
                view = WorkItem.Items.AddNew<FileManagerView>();
				TabSmartPartInfo info = new TabSmartPartInfo();
				info.Title = "File Manager";
				info.Description = "File Manager";
                WorkItem.Workspaces[CustomerWorkItem.CUSTOMERDETAIL_TABWORKSPACE].Show(view, info);
			}
		}
	}
}
